package com.library.bookinfo.controller;

import com.library.bookinfo.service.BookinfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BookinfoController {
    private static final Logger logger = LoggerFactory.getLogger(BookinfoController.class);

    @Autowired
   private BookinfoService bookinfoService;



    @RequestMapping("/excel")
    @ResponseBody
    public String unscrambleExcel(){
        String cost="";
        try {
           cost =bookinfoService.InsertFromExcelFile1("E://books.xlsx");


        }
        catch (Exception e){
           logger.error(e.getMessage());
        }
        return "SUCCESS，用时："+cost;
    }
}
